function tildeP = findtildeP(Xit,Pspot,MU)
%findtildeP is a function that helps us find the guarantted price given
%history.
%tildeP=min[P_1(lambda_1),P_2(lambda_2),..., P_t(Lambda_t)]
th=length(Xit);
%first we find guaranteed price tildeP

tildeP=max(MU, [], 'all');
for i=1:(th)
    if tildeP>Pspot(Xit(i),i)
        tildeP=Pspot(Xit(i),i);
    end
end
end